package com.wc.alorithm_luogu._贪心.P4447_分组;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/18 16:03
 * @description https://www.luogu.com.cn/problem/P4447
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static int[] a = new int[N];
    // q[i] 表示以q[i]结尾的组
    static int[] q = new int[N];
    // cnt[i]表示q[i]组里面有多少人, 并且倒叙排列，争取加入到最少的人的组里面，就可以保证最少的人最多
    static int[] cnt = new int[N];
    static int len = 0;
    static int n;

    // 思路：https://www.luogu.com.cn/article/vw5tquu8
    // 给每一个数上，前面的数一定是大组的，后面的一定是小组，只需要给最后面的上就好了，上不了
    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 1; i <= n; i++) a[i] = sc.nextInt();
        Arrays.sort(a, 1, n + 1);
        for (int i = 1; i <= n; i++) {
            int k = find(a[i] - 1);
            // 没有找到队伍
            if (k == -1) {
                q[++len] = a[i];
                cnt[len] = 1;
                continue;
            }
            cnt[k]++;
            q[k] = a[i];
        }
        int res = 0x3f3f3f3f;
        for (int i = 1; i <= len; i++) res = Math.min(res, cnt[i]);
        out.println(res);
        out.flush();
    }

    static int find(int x) {
        int l = 1, r = len;
        while (l < r) {
            int mid = l + r + 1>> 1;
            if (q[mid] <= x) l = mid;
            else r = mid - 1;
        }

        return q[r] == x ? r : -1;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}